package com.xbongbong.pro.businessdata.pojo.dto;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.dto.FormDataAddGetDTO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.formdata.pojo.SaasSpecialParamPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author feng.zheng
 * @version v1.0
 * @date 2019/2/12 16:15
 * @since v1.0
 */
@Setter
@Getter
@ToString
public class FormatExplainDTO extends FormDataAddGetDTO {

    private static final long serialVersionUID = 6668759504188071884L;

    /**
     * 业务类型
     */
    @NotNull(message = "{dto.msg.formatExplain.businessType.NotNull}")
    private Integer businessType;

    /**
     * 关联业务类型
     */
    @NotNull(message = "{dto.msg.formatExplain.linkBusinessType.NotNull}")
    private Integer linkBusinessType;

    /**
     * 关联子业务类型
     */
    private Integer subBusinessType;

    /**
     * 表单解释
     */
    private List<FieldAttrEntity> explainList;

    /**
     * 业务实体
     */
    private PaasFormDataEntityExt dataEntity;

    /**
     * 数据
     */
    private JSONObject result;

    /**
     * 是否编辑的时候格式化解释
     */
    private Boolean editFormat;

    private Boolean fromCopy;
    /**
     * 盘点，调拨有下游单据在审批中的标识
     */
    private Boolean hasSheetInApproval;

    private FieldAttrEntity productField;

    public FormatExplainDTO() {
    }

    public FormatExplainDTO(String corpid, List<FieldAttrEntity> explainList) {
        this.setCorpid(corpid);
        this.explainList = explainList;
    }


    public FormatExplainDTO(String corpid, List<FieldAttrEntity> explainList, UserVO userVO) {
        this.setCorpid(corpid);
        this.explainList = explainList;
        setLoginUser(userVO);
    }

    public FormatExplainDTO(String corpid, List<FieldAttrEntity> explainList, Boolean fromCopy, SaasSpecialParamPojo saasSpecialParamPojo, PaasFormDataEntityExt dataEntity, UserVO userVO) {
        this.setCorpid(corpid);
        this.explainList = explainList;
        this.fromCopy = fromCopy;
        this.dataEntity = dataEntity;
        setLoginUser(userVO);
        setSaasSpecialParamPojo(saasSpecialParamPojo);
    }
}
